package com.tbit.main.dao.core;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tbit.main.pojo.DetentionArea;
import com.tbit.main.pojo.VO.DetentionVo;
import com.tbit.main.pojo.Warehouse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: chen
 * @Description:
 * @Date: 创建于 17:33 2023/2/7
 */
@Mapper
public interface DetentionAreaDao extends BaseMapper<DetentionArea> {

    List<DetentionArea> getByAccountId(Integer accountId);

    List<DetentionVo> getAllDetention(Integer accountId);

    DetentionArea getNearDetention(@Param("accountId") Integer accountId,@Param("lo") Double lo,@Param("la") Double la);

    List<DetentionArea> getNear(Double la, Double lo, Integer accountId);

    DetentionArea getByDetentionId(Integer detentionId);

    DetentionArea getDetentionByName(@Param("accountId") Integer accountId,@Param("detentionId")Integer detentionId, @Param("name")String name);

    /**
     * 根据accountId和名称查询扣押区
     *
     * @param accountId         区域id
     * @param detentionAreaName 扣押区名称
     */
    DetentionArea getByDetentionAreaName(@Param("accountId") Integer accountId, @Param("detentionAreaName") String detentionAreaName);
}
